55 LOCATE 5,1:IF BF=1 THEN 100 ELSE PRINT " (Enter RETURN if you wish to evaluate significance of a known R value)"
60 LOCATE 4,1:GOSUB 4000:BF=1:GOTO 100
65 AF=1:LOCATE 8,25:INPUT;"Enter R value: ",SR:SR2=SR*SR
70 IF ABS(SR)>=1 THEN BEEP:LOCATE 25,3:PRINT "Your correlation coefficient should be a decimal fraction between -1 and 1.";:LOCATE 8,41:PRINT " ":GOTO 65
75 LOCATE 9,25:INPUT "Number of data pairs: ",N:GOTO 120
80 PRINT:PRINT:PRINT " What are the SAMPLE NUMBERS of the 2 variables you want to correlate?":PRINT:AR=CSRLIN
90 IF T(NS1)<>T(NS2) THEN PRINT:PRINT "These 2 samples do not have the same number of elements----":PRINT TAB(32);"a correlation coefficient cannot be calculated.":GOTO 235
95 N=T(NS1):RETURN
100 GOSUB 80:XC=0:FOR Z=1 TO N:XC=XC+VAL(D(NS1,Z))*VAL(D(NS2,Z)):NEXT
230 PRINT:PRINT:PRINT "The probability that a given value of Spearman's correlation coefficient is":PRINT " significantly different than 0 can be evaluated by reference to tables.":PRINT TAB(26);"(See Colton, p. 353)"
235 LOCATE 25,1:PRINT TAB(79):DQ="Would you like to "
240 IF AF=1 THEN LOCATE 25,8:PRINT DQ;:INPUT;"evaluate another correlation coefficient? ",A$:IF A$="y" OR A$="Y" THEN CLS:GOTO 65 ELSE 255
245 LOCATE 25,1:PRINT DQ;:INPUT;"calculate another correlation using this DATAFILE? ",A$:IF A$="y" OR A$="Y" THEN 20
250 LOCATE 25,55:INPUT;"a different DATAFILE? ",A$:IF A$="y" OR A$="Y" THEN BF=0:GOTO 20
255 LOCATE 23,1:END
4010 IF FILE$="" THEN 65
4025 ERASE D,CS,N$,X,X2,T,MD,SD
4030 DIM D(A,C),CS(A,C),N$(A),X(A),X2(A),T(A),MD(A),SD(A)
5000 BEEP:IF ERR<>53 AND ERR<>71 THEN 5010 ELSE LOCATE 10,10:PRINT "Please place EPISTAT in drive A: (or other default).":PRINT TAB(25);"Press any key to continue:"